home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / TSPA2560.ARJ / TSUNTG.INT < prev    next >
Text File  |  1991-10-27  |  6KB  |  172 lines

  1. {$B-,D-,F-,I+,N-,R-,S+,V+}
  2.  
  3. (*
  4. Timo Salmi UNiT G
  5. A Turbo Pascal unit of informative routines, Crt replacements,
  6. redirection, and reboot.
  7. All rights reserved 26-Nov-89
  8. Updated 6-Dec-89, 20-Mar-90, 22-Jul-90, 1-Aug-90, 8-Aug-90, 27-Oct-91
  9.  
  10. This unit may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
  11. NON-INSTITUTIONAL purposes, provided it is not changed in any way. For
  12. ANY other usage, such as use in a business enterprise or a university,
  13. contact the author for the terms of registration.
  14.  
  15. The units are under development. Comments and contacts are solicited. If
  16. you have any questions, please do not hesitate to use electronic mail for
  17. communication.
  18. InterNet address: ts@chyde.uwasa.fi         (preferred)
  19. Funet address:    GADO::SALMI
  20. Bitnet address:   SALMI@FINFUN
  21.  
  22. The author shall not be liable to the user for any direct, indirect or
  23. consequential loss arising from the use of, or inability to use, any unit,
  24. program or file howsoever caused. No warranty is given that the units and
  25. programs will work under all circumstances.
  26.  
  27. Timo Salmi
  28. Professor of Accounting and Business Finance
  29. School of Business Studies, University of Vaasa
  30. P.O. BOX 297, SF-65101 Vaasa, Finland
  31.  
  32. Added 27-Oct-91:
  33.  ISANSIFN
  34. *)
  35.  
  36. unit TSUNTG;
  37.  
  38. (* ======================================================================= *)
  39.                           interface
  40. (* ======================================================================= *)
  41.  
  42. uses Dos
  43.      {$IFDEF VER40}
  44.      ,TSUNT45
  45.      {$ENDIF}
  46.      ;
  47.  
  48. (* =======================================================================
  49.                      Informative routines
  50.    ======================================================================= *)
  51.  
  52. (* Number of diskette drives on the system *)
  53. function DRIVESFN : byte;
  54.  
  55. (* The name of the first diskette drive on the system *)
  56. function FDRIVEFN : char;
  57.  
  58. (* Number of disk devices. Only for MsDos 3.+, else returns 0, harcoded *)
  59. function DSKCNTFN : byte;
  60.  
  61. (* Is a media present in the given drive. Argument '0' can be used to
  62.    denote the default drive *)
  63. function INDRIVFN (drive : char) : boolean;
  64.  
  65. (* Is a media a fixed disk. Takes the drive letter (case independent) as
  66.    the argument. Argument '0' can be used for the default drive *)
  67. function FIXEDFN (drive : char) : boolean;
  68.  
  69. (* =======================================================================
  70.                Crt replacements and their derivates
  71.    ======================================================================= *)
  72.  
  73. (* Set a 25*80 text mode and clear screen, no Crt unit required *)
  74. procedure CLS;
  75.  
  76. (* Set a 25*40 text mode and clear screen, no Crt unit required *)
  77. procedure CLS40;
  78.  
  79. (* As Turbo Pascal GoToYX but does not require the Crt unit *)
  80. procedure GOATXY (x, y : integer);
  81.  
  82. (* As Turbo Pascal WhereX but does not require the Crt unit *)
  83. function WHEREXFN : byte;
  84.  
  85. (* As Turbo Pascal WhereY but does not require the Crt unit *)
  86. function WHEREYFN : byte;
  87.  
  88. (* Reverse the colors of an area.
  89.    This is slow. For fast screen routines see TSUNTA. *)
  90. procedure REVAREA (x1, y1, x2, y2 : integer);
  91.  
  92. (* Returns whether ANSI.SYS or a similar driver has been loaded or not.
  93.    Use while in the text mode. Do not call not in the graphics modes.
  94.    Don't use the TP Crt unit in your program if you want ISANSIFN to work. *)
  95. function ISANSIFN : boolean;
  96.  
  97. (* =======================================================================
  98.                 Key routines with no Ctr needed
  99.    ======================================================================= *)
  100.  
  101. (* As Turbo Pascal KeyPressed but does not require the Crt unit *)
  102. function KEYPREFN : boolean;
  103.  
  104. (* As Turbo Pascal ReadKey but does not require the Crt unit *)
  105. function READKEFN : char;
  106.  
  107. (* Enhanced keyboard ReadKey, no Ctr unit needed. Detects also F11 and F12,
  108.    and distinguishes between the numeric keypad and the gray keys.
  109.    Lower part of the word returns the first scan code, the higher part
  110.    the second, if applicable. *)
  111. function RDENKEFN : word;
  112.  
  113. (* This function resembles the traditional Basic inkey function.
  114.    It returns the pressed character with no echo. Special chacarters
  115.    are returned in the usual paired manner (chr(0) + code).
  116.    If timelimit seconds is exceeded timeout becomes true (and a
  117.    chr(0) is returned by inkeyfn). *)
  118. function INKEYFN (timelimit : real; var timeout : boolean) : char;
  119.  
  120. (* =======================================================================
  121.         More key routines with no Ctr needed, no key repeat
  122.    ======================================================================= *)
  123.  
  124. (* Is the left shift key depressed *)
  125. function LFSHFTFN : boolean;
  126.  
  127. (* Is the right shift key depressed *)
  128. function RTSHFTFN : boolean;
  129.  
  130. (* Is the ctrl key depressed *)
  131. function CTRLFN : boolean;
  132.  
  133. (* Is the left ctrl key depressed *)
  134. function LFCTRLFN : boolean;
  135.  
  136. (* Is the right ctrl key depressed *)
  137. function RTCTRLFN : boolean;
  138.  
  139. (* Is the alt key depressed *)
  140. function ALTFN : boolean;
  141.  
  142. (* Is the left alt key depressed *)
  143. function LFALTFN : boolean;
  144.  
  145. (* Is the right alt key depressed *)
  146. function RTALTFN : boolean;
  147.  
  148. (* Is the SysRq key depressed *)
  149. function SYSRQFN : boolean;
  150.  
  151. (* =======================================================================
  152.                       Redirection
  153.    ======================================================================= *)
  154.  
  155. (* Direct write and writeln to printer *)
  156. procedure USEPRN;
  157.  
  158. (* Direct write and writeln to the screen *)
  159. procedure USECON;
  160.  
  161. (* =======================================================================
  162.                            Reboot
  163.    ======================================================================= *)
  164.  
  165. (* Reboot the computer without memory tests. Resembles alt-ctrl-del.
  166.    Inline coded. Use judiciously *)
  167. procedure WARMBOOT;
  168.  
  169. (* Reboot the computer with memory tests. Inline coded. Use judiciously *)
  170. procedure COLDBOOT;
  171.  
  172.